#pragma once

#include <MCF/Code/StdMCF.hpp>
#include <MCF/Code/WindowBaseClass.hpp>
#include <MCF/Code/TabControlClass.hpp>
#include "AsyncWriteTextControlClass.hpp"

class TabRegistersClass sealed : public MCF::TabDialogBaseClass {
private:
	static bool _EventRegInvalidatedProc(std::intptr_t nContext, std::intptr_t nArg1, std::intptr_t nArg2, std::intptr_t nArg3);
private:
	AsyncWriteTextControlClass _m_aredtGPRs[64];

	AsyncWriteTextControlClass _m_edtUINT64ResultHi;
	AsyncWriteTextControlClass _m_edtUINT64ResultLo;

	MCF::WindowBaseClass _m_chkIntAllowed;
	MCF::WindowBaseClass _m_chkOldIntAllowed;
	AsyncWriteTextControlClass _m_edtIntEnMask;
	AsyncWriteTextControlClass _m_edtIntFlags;
	AsyncWriteTextControlClass _m_edtIntRetAddr;

	AsyncWriteTextControlClass _m_edtPC;
	AsyncWriteTextControlClass _m_edtInstCount;
	AsyncWriteTextControlClass _m_edtInstruction;
	AsyncWriteTextControlClass _m_edtDisasm;
public:
	TabRegistersClass(HWND hParent);
	virtual ~TabRegistersClass();
protected:
	virtual void _PostSubclass() override;
	virtual void _PreUnsubclass() override;

	virtual bool _OnInitDialog(HWND hDefControl, LPARAM lInitParam) override;
private:
	void _UpdateRegEditBox(unsigned int uRegIndex);
};
